#ifndef __UART_H__
#define __UART_H__

#include "debug.h"

#define RXBUF_SIZE (256)

extern u8 rxBuffer[RXBUF_SIZE];
extern uint16_t rxBufferReadPos;

void UART1_GPIO_Init(void);
void UART1_Init(uint32_t baudrate);
void UART1_DMA_Init(void);

char uartWriteBlocking(char *data, uint16_t num);
char uartWriteStrBlocking(char *str);
uint32_t uartRead(char *buffer, uint16_t num);
char uartReadByte(void);
uint16_t uartAvailable(void);
char uartPeek(uint8_t Serial_num, uint16_t offset);

void UARTx_DMA_init(uint32_t btl);

#endif